package net.neptech.factory;
import com.alibaba.nls.client.protocol.NlsClient;

public class NlsClientFactory {
    private static volatile NlsClient client;

    public static NlsClient getClient(String akId, String akSecret) {
        if (client == null) {
            synchronized (NlsClientFactory.class) {
                if (client == null) {
                    client = new NlsClient(akId, akSecret);
                }
            }
        }
        return client;
    }

    public static void shutdown() {
        if (client != null) client.shutdown();
    }
}